var t = getApp();

Page({
    data: {
        page: 1,
        kFootshow: !0,
        iPnoneBottomBol: !1
    },
    onLoad: function(t) {
        this.getiPnoneBottom(), this.getData();
    },
    goindex: function() {
        wx.navigateTo({
            url: "/packageE/others/skin/skin"
        });
    },
    tabrshowbtn: function(t) {
        t.detail && this.setData({
            kFootshow: !1
        });
    },
    getiPnoneBottom: function() {
        try {
            wx.getStorageSync("iPhoneBottom") && this.setData({
                iPnoneBottomBol: !0
            });
        } catch (t) {}
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.current_page > this.data.last_page)) {
            var t = this.data.page + 1;
            this.setData({
                page: t
            }), this.getMore();
        }
    },
    onShareAppMessage: function() {},
    getData: function() {
        wx.showLoading({
            title: "加载中"
        });
        var a = this, n = t.getNetAddresss("plugin.skin-check.api.skin-check.ranking-list");
        t._getNetWork({
            url: n,
            data: {
                page: a.data.page
            },
            success: function(t) {
                wx.hideLoading({
                    complete: function(t) {}
                });
                var n = t.data;
                console.log(n), 1 == n.result ? a.setData({
                    member: n.data.my,
                    ranking_list: n.data.ranking_list,
                    current_page: n.data.ranking_list.current_page,
                    last_page: n.data.ranking_list.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: n.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t), wx.hideLoading({
                    complete: function(t) {}
                });
            }
        });
    },
    getMore: function() {
        wx.showLoading({
            title: "加载中"
        });
        var a = this, n = t.getNetAddresss("plugin.skin-check.api.skin-check.ranking-list");
        t._getNetWork({
            url: n,
            data: {
                page: a.data.page
            },
            success: function(t) {
                wx.hideLoading({
                    complete: function(t) {}
                });
                var n = t.data;
                console.log(n), 1 == n.result ? a.setData({
                    member: n.data.my,
                    ranking_list: a.data.ranking_list.concat(n.data.ranking_list),
                    current_page: n.data.ranking_list.current_page,
                    last_page: n.data.ranking_list.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: n.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t), wx.hideLoading({
                    complete: function(t) {}
                });
            }
        });
    }
});